package com.example.controller;

import com.example.domain.CultureProject;
import com.example.domain.vo.Result;
import com.example.service.CultureMapService;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/front/culture/map")
@Slf4j
public class CultureMapController {
    @Autowired
    private CultureMapService cultureMapService;

    @GetMapping
    public Result queryCulture(CultureProject cultureProject,
                               @RequestParam(defaultValue = "1") Integer currentPage,
                               @RequestParam(defaultValue = "10") Integer pageSize) {
        PageInfo<CultureProject> project = cultureMapService.queryCulture(cultureProject, currentPage, pageSize);
        return Result.success(project);
    }
}
